package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallCoupon;
import com.appkubes.mall.core.po.MallCouponExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallCouponMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCouponSqlProvider.class, method="countByExample")
    long countByExample(MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallCouponSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_coupon",
        "where coupon_key = #{couponKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String couponKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_coupon (coupon_key, app_key, ",
        "`name`, begin_time, ",
        "end_time, use_money, ",
        "money, `days`, num, ",
        "left_num, `position`, ",
        "image_url, create_time, ",
        "update_time, `state`, ",
        "goods_key, use_score, ",
        "active_type, use_area, ",
        "`type`, usercoupon_key, ",
        "version, info)",
        "values (#{couponKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR}, #{beginTime,jdbcType=INTEGER}, ",
        "#{endTime,jdbcType=INTEGER}, #{useMoney,jdbcType=DECIMAL}, ",
        "#{money,jdbcType=DECIMAL}, #{days,jdbcType=INTEGER}, #{num,jdbcType=INTEGER}, ",
        "#{leftNum,jdbcType=INTEGER}, #{position,jdbcType=TINYINT}, ",
        "#{imageUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, ",
        "#{goodsKey,jdbcType=VARCHAR}, #{useScore,jdbcType=INTEGER}, ",
        "#{activeType,jdbcType=VARCHAR}, #{useArea,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=TINYINT}, #{usercouponKey,jdbcType=VARCHAR}, ",
        "#{version,jdbcType=INTEGER}, #{info,jdbcType=LONGVARCHAR})"
    })
    int insert(MallCoupon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallCouponSqlProvider.class, method="insertSelective")
    int insertSelective(MallCoupon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCouponSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.INTEGER),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.INTEGER),
        @Result(column="use_money", property="useMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="days", property="days", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="left_num", property="leftNum", jdbcType=JdbcType.INTEGER),
        @Result(column="position", property="position", jdbcType=JdbcType.TINYINT),
        @Result(column="image_url", property="imageUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_score", property="useScore", jdbcType=JdbcType.INTEGER),
        @Result(column="active_type", property="activeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_area", property="useArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="usercoupon_key", property="usercouponKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER),
        @Result(column="info", property="info", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<MallCoupon> selectByExampleWithBLOBsWithRowbounds(MallCouponExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCouponSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.INTEGER),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.INTEGER),
        @Result(column="use_money", property="useMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="days", property="days", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="left_num", property="leftNum", jdbcType=JdbcType.INTEGER),
        @Result(column="position", property="position", jdbcType=JdbcType.TINYINT),
        @Result(column="image_url", property="imageUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_score", property="useScore", jdbcType=JdbcType.INTEGER),
        @Result(column="active_type", property="activeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_area", property="useArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="usercoupon_key", property="usercouponKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER),
        @Result(column="info", property="info", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<MallCoupon> selectByExampleWithBLOBs(MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCouponSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.INTEGER),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.INTEGER),
        @Result(column="use_money", property="useMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="days", property="days", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="left_num", property="leftNum", jdbcType=JdbcType.INTEGER),
        @Result(column="position", property="position", jdbcType=JdbcType.TINYINT),
        @Result(column="image_url", property="imageUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_score", property="useScore", jdbcType=JdbcType.INTEGER),
        @Result(column="active_type", property="activeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_area", property="useArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="usercoupon_key", property="usercouponKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCoupon> selectByExampleWithRowbounds(MallCouponExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCouponSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.INTEGER),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.INTEGER),
        @Result(column="use_money", property="useMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="days", property="days", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="left_num", property="leftNum", jdbcType=JdbcType.INTEGER),
        @Result(column="position", property="position", jdbcType=JdbcType.TINYINT),
        @Result(column="image_url", property="imageUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_score", property="useScore", jdbcType=JdbcType.INTEGER),
        @Result(column="active_type", property="activeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_area", property="useArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="usercoupon_key", property="usercouponKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCoupon> selectByExample(MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "coupon_key, app_key, `name`, begin_time, end_time, use_money, money, `days`, ",
        "num, left_num, `position`, image_url, create_time, update_time, `state`, goods_key, ",
        "use_score, active_type, use_area, `type`, usercoupon_key, version, info",
        "from mall_coupon",
        "where coupon_key = #{couponKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.INTEGER),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.INTEGER),
        @Result(column="use_money", property="useMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="money", property="money", jdbcType=JdbcType.DECIMAL),
        @Result(column="days", property="days", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="left_num", property="leftNum", jdbcType=JdbcType.INTEGER),
        @Result(column="position", property="position", jdbcType=JdbcType.TINYINT),
        @Result(column="image_url", property="imageUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_score", property="useScore", jdbcType=JdbcType.INTEGER),
        @Result(column="active_type", property="activeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="use_area", property="useArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="usercoupon_key", property="usercouponKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER),
        @Result(column="info", property="info", jdbcType=JdbcType.LONGVARCHAR)
    })
    MallCoupon selectByPrimaryKey(String couponKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCouponSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallCoupon record, @Param("example") MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCouponSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") MallCoupon record, @Param("example") MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCouponSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallCoupon record, @Param("example") MallCouponExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCouponSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallCoupon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @Update({
        "update mall_coupon",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "begin_time = #{beginTime,jdbcType=INTEGER},",
          "end_time = #{endTime,jdbcType=INTEGER},",
          "use_money = #{useMoney,jdbcType=DECIMAL},",
          "money = #{money,jdbcType=DECIMAL},",
          "`days` = #{days,jdbcType=INTEGER},",
          "num = #{num,jdbcType=INTEGER},",
          "left_num = #{leftNum,jdbcType=INTEGER},",
          "`position` = #{position,jdbcType=TINYINT},",
          "image_url = #{imageUrl,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "`state` = #{state,jdbcType=INTEGER},",
          "goods_key = #{goodsKey,jdbcType=VARCHAR},",
          "use_score = #{useScore,jdbcType=INTEGER},",
          "active_type = #{activeType,jdbcType=VARCHAR},",
          "use_area = #{useArea,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=TINYINT},",
          "usercoupon_key = #{usercouponKey,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER},",
          "info = #{info,jdbcType=LONGVARCHAR}",
        "where coupon_key = #{couponKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(MallCoupon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_coupon
     *
     * @mbg.generated
     */
    @Update({
        "update mall_coupon",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "begin_time = #{beginTime,jdbcType=INTEGER},",
          "end_time = #{endTime,jdbcType=INTEGER},",
          "use_money = #{useMoney,jdbcType=DECIMAL},",
          "money = #{money,jdbcType=DECIMAL},",
          "`days` = #{days,jdbcType=INTEGER},",
          "num = #{num,jdbcType=INTEGER},",
          "left_num = #{leftNum,jdbcType=INTEGER},",
          "`position` = #{position,jdbcType=TINYINT},",
          "image_url = #{imageUrl,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "`state` = #{state,jdbcType=INTEGER},",
          "goods_key = #{goodsKey,jdbcType=VARCHAR},",
          "use_score = #{useScore,jdbcType=INTEGER},",
          "active_type = #{activeType,jdbcType=VARCHAR},",
          "use_area = #{useArea,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=TINYINT},",
          "usercoupon_key = #{usercouponKey,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where coupon_key = #{couponKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallCoupon record);
}